/**
 * 
 */
package org.corpus.english.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.corpus.english.model.Sentence;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Listbox;


/**
 * @author robbiecheng
 *
 */
public class SentenceSearchResultController extends GenericForwardComposer{
	private Sentence current = new Sentence();
	public void setCurrent(Sentence current) {
		this.current = current;
	}
	public Sentence getCurrent() {
		return current;
	}
	//update sentence
	public void onClick$updateBtn(){
		UpdateManager.updateSentence(current.getSentenceid());
	}
	//export to word
	Listbox resultList;
	public void onClick$exportToWordBtn(){
		Map args = new HashMap();
		List result = new ArrayList(resultList.getSelectedItems());
		args.put("results", result);
		UpdateManager.exporToWord(args, UpdateManager.SENTENCE_WORD_URL);
	}
}
